Skip to content

chore: rearrange plugin wrapper #1668

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 14, 2022
Merged

chore: rearrange plugin wrapper #1668

merged 2 commits into from
Oct 14, 2022

Conversation

ascorbic
Copy link
Contributor

@ascorbic ascorbic commented Oct 7, 2022

Summary

Currently we use a local plugin plugin-wrapper which re-exports the runtime package, to ensure that @netlify/build doesn't error out when the runtime hasn't been built yet. The problem is that because the wrapper isn't called @netlify/plugin-nextjs, the CLI attempts to auto-install the runtime, leading to errors from double installs. The same problem occurs when running demo sites locally.

This PR changes the demo sites to specify the runtime package as @netlify/plugin-nextjs. This is correctly resolved in the monorepo so that it loads the local version. However we still need to work around the need to compile the runtime. The wrokaround here is two-fold. First we change the entrypoint in the runtime from the compiled lib/index.js, to a static file in the root index.js which re-exports lib/index.js. This means that when build starts, it is able to resolve the entrypoint file and not throw an error. We keep the plugin-wrapper plugin, but make it empty and just use it to ensure that npm install is run, which in turn builds the runtime.

Test plan

  1. Ensure the demo sites build

Relevant links (GitHub issues, Notion docs, etc.) or a picture of cute animal

batcapy

Standard checks:

  • Check the Deploy Preview's Demo site for your PR's functionality
  • Add docs when necessary

🧪 Once merged, make sure to update the version if needed and that it was published correctly.

@ascorbic ascorbic requested a review from a team October 7, 2022 10:15
@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for netlify-plugin-nextjs-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-demo/deploys/63496b1ba3c72e00090f3012
😎 Deploy Preview https://deploy-preview-1668--netlify-plugin-nextjs-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for next-hp-edge-demo ready!

Name Link
🔨 Latest commit 941c67a
🔍 Latest deploy log https://app.netlify.com/sites/next-hp-edge-demo/deploys/633fff22e020ec0008f13ace
😎 Deploy Preview https://deploy-preview-1668--next-hp-edge-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for netlify-plugin-nextjs-nx-monorepo-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-nx-monorepo-demo/deploys/63496b1b91b88e000871fd6c
😎 Deploy Preview https://deploy-preview-1668--netlify-plugin-nextjs-nx-monorepo-demo.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions bot added the type: chore work needed to keep the product and development running smoothly label Oct 7, 2022
@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for netlify-plugin-nextjs-static-root-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-static-root-demo/deploys/63496b1bcce08d0008070d5d
😎 Deploy Preview https://deploy-preview-1668--netlify-plugin-nextjs-static-root-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for netlify-plugin-nextjs-next-auth-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-next-auth-demo/deploys/63496b1b837a43000988217e
😎 Deploy Preview https://deploy-preview-1668--netlify-plugin-nextjs-next-auth-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for next-plugin-edge-middleware ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-edge-middleware/deploys/63496b1b421a660009a52b3e
😎 Deploy Preview https://deploy-preview-1668--next-plugin-edge-middleware.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for next-plugin-canary ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-canary/deploys/63496b1b2ce40a0009483682
😎 Deploy Preview https://deploy-preview-1668--next-plugin-canary.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for next-i18next-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/next-i18next-demo/deploys/63496b1bad3f1700099e3ca9
😎 Deploy Preview https://deploy-preview-1668--next-i18next-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for nextjs-plugin-custom-routes-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/nextjs-plugin-custom-routes-demo/deploys/63496b1b837a430009882183
😎 Deploy Preview https://deploy-preview-1668--nextjs-plugin-custom-routes-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for netlify-plugin-nextjs-export-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/netlify-plugin-nextjs-export-demo/deploys/63496b1b11e5f80008bacc5b
😎 Deploy Preview https://deploy-preview-1668--netlify-plugin-nextjs-export-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@netlify
Copy link

netlify bot commented Oct 7, 2022

Deploy Preview for next-plugin-rsc-demo ready!

Name Link
🔨 Latest commit b226c6f
🔍 Latest deploy log https://app.netlify.com/sites/next-plugin-rsc-demo/deploys/63496b1b523a5a000aadf0a6
😎 Deploy Preview https://deploy-preview-1668--next-plugin-rsc-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@ascorbic ascorbic force-pushed the mk/internal-plugin branch from 633b6b0 to f7be133 Compare October 7, 2022 10:24
@ascorbic ascorbic force-pushed the mk/internal-plugin branch from f7be133 to 941c67a Compare October 7, 2022 10:27
@kodiakhq kodiakhq bot merged commit ad01f58 into main Oct 14, 2022
@kodiakhq kodiakhq bot deleted the mk/internal-plugin branch October 14, 2022 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge type: chore work needed to keep the product and development running smoothly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants